-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Improved retrofit timeout handling. #1618
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved retrofit timeout handling. #1618
Conversation
@slandelle, i'm a bit confused about AHC timeouts; as seen from newly created test it's possible to set read timeout to a higher value than request timeout. Which of those values are then being used by AHC instance? If request timeout is always enforced i'll change retrofit timeout computation method. |
If read timeout is longer than request timeout, it will be ignored. |
@slandelle i've just pushed c3585b1 with updated timeout computation method. Does it make sense to you? If yes, i'm going to squash commit, then you're free to merge. |
No, that doesn't work. |
So what would you suggest? In essence, what i would like to achieve in this PR is to retrieve correct timeout from actual configuration of http client that is going to execute this call; this is improvement, because previously, timeout has been semi-hardcoded in a field and was not configurable by the user. |
Just map on request timeout. |
👍 i've updated the code, squashed commits; now solely request timeout is used; you're free to merge. And yeah, this time i've tested snapshot with my service :-) Releasing new fix version would be awesome, but it's up to you. |
Retrofit `Call` now uses http client's configured request timeout to compute value for `timeout()` and blocking `execute()` method execution timeout.
@bfg I can't release because your PR breaks javadoc (which is required in order to release on maven central). Could you please fix? |
Sigh, sure, on it :-) |
@slandelle it builds successfully for me using maven |
Can you check retrofit_javadoc_issue branch on my fork? |
I've managed to reproduce javadoc issue. Build works without issues on openjdk 8, but it fails on oracle jdk 8 🤦♂️
I'll find a way to work around this issue, one way or another :-) |
Retrofit
Call
now uses http client's configured timeout to computevalue for
timeout()
and blockingexecute()
method execution timeout.